$(document).ready(function() {
	$('#close_form').click(function() {
		window.location = "/Article/list";
	});
	$('#submit_form').click(function() {

		var __editForm = $('#form_article_edit');
		var oEditor = CKEDITOR.instances.editor;
		var contentEditor = oEditor.getData();
		var objArtiForm = {
			__formId: $("input[name='art_id']", __editForm),
			__formTitle: $("input[name='art_title']", __editForm),
			__formType: $("select[name='art_type']", __editForm),
			__formAuthor: $("input[name='art_author']", __editForm),
			__formSource: $("input[name='art_source']", __editForm),
			__formStatu: $("select[name='art_statu']", __editForm)

		}


		$.ajax({
			type: "POST",
			url: "/Article/edit/id/" + objArtiForm.__formId.val(),
			data: {
				//"article_id" : objArtiForm.__formId.val(),
				"title": objArtiForm.__formTitle.val(),
				"article_type_id": objArtiForm.__formType.val(),
				"author": objArtiForm.__formAuthor.val(),
				"source": objArtiForm.__formSource.val(),
				"status": objArtiForm.__formStatu.val(),

				"content": contentEditor

			},
			success: function(data) {

				layer.alert(data.info, function() {
					if (true === data.status) window.location = "/Article/list";
				});
			}
		});
		return false;

	});
})